In generally, cover mechanisms are widely applied to electronic devices to protect external ports of the electronic devices. The cover mechanism includes a cover and a latch engaging with the cover. When the cover is disengaged from the case by an external force, the cover is held open by a user, which is inconvenient for the user to use the ports.